/*******************************************************************************
 *  Copyright (c) 2010 Chase Technology Ltd.
 *  
 *  All rights reserved. This program and the accompanying materials
 *  are made available under the terms of the GNU General Public License v3.0
 *  which is available at http://www.gnu.org/licenses/
 * 
 * Contributors:
 *     Doug Satchwell - initial API and implementation
 *******************************************************************************/
package org.jfunction;

import java.util.HashMap;
import java.util.Map;

public class Example {
	
	private static Example current;
	
	private final Map<String,Object> context = new HashMap<String,Object>();
	private String description;
	
	public void setDescription(String description) {
		this.description = description;
	}
	
	public String getDescription(){
		return description;
	}
	
	public boolean hasValue(String key) {
		return context.containsKey(key);
	}

	public void setValue(String key, Object value) {
		context.put(key, value);
	}
	
	public Object getValue(String key) {
		return context.get(key);
	}
	
	/* package */ static void setCurrent(Example example) {
		current = example;
	}
	
	public static Example getCurrent() {
		return current;
	}
}
